package org.moonlight.jvm.natives.java.lang.doubles;

import org.moonlight.jvm.natives.AbstractNativeMethod;
import org.moonlight.jvm.rtda.exclusive.Frame;

/**
 * java.lang.Double public static native double longBitsToDouble(Long value);
 *
 * @author Moonlight
 * @createTime 2023/9/28 11:39
 **/
public class LongBitsToDouble extends AbstractNativeMethod {

    public LongBitsToDouble() {
        super("java/lang/Double", "longBitsToDouble", "(J)D");
    }

    @Override
    public void nativeMethod(Frame frame) {
        long val = frame.getLocalVars().getLong(0);
        double dbVal = Double.longBitsToDouble(val);
        frame.getOperandStack().pushDouble(dbVal);
    }
}
